import Vue from "vue";
import Router from "vue-router";
Vue.use(Router);
import Layout from "@/components/layout/layout";
export const constantRouterMap = [
  {
    path: "/login",
    component: () => import("@/views/login/index"),
    hidden: true
  },

  {
    path: "/dataManage",
    component: Layout,
    redirect: "/dataManage",
    name: "code_200",
    meta: {
      title: "数据管理",
      icon: "home"
    },
    children: [
      {
        path: "dataList",
        name: "DATALIST",
        component: () => import("@/views/dataManage/dataManage"),
        meta: {
          title: "数据管理",
          icon: "desktop"
        }
      }
    ]
  },
  // {
  //   path: '/',
  //   component: Layout,
  //   redirect: '/index',
  //   name: 'code_100',
  //   meta: { title: '首页', icon: '' },
  //   children: [{
  //       path: '/',
  //       name: 'code_100',
  //       component: () =>
  //           import ('@/views/dataManage/dataManage'),
  //       meta: {
  //           // title: '首页',
  //           // icon: require('../../static/img/ic01.png'),
  //           // icon2: require('../../static/img/icC01.png')
  //       }
  //   }, ]
  // },

  {
    path: "/user",
    component: Layout,
    redirect: "/user",
    name: "code_300",
    meta: {
      title: "用户管理",
      icon: "home"
    },
    children: [
      {
        path: "role",
        name: "code_1000",
        component: () => import("@/views/role/roleList"),
        meta: {
          title: "角色管理",
          icon: "desktop"
        }
      },
      {
        path: "account",
        name: "code_1100",
        component: () => import("@/views/role/account"),
        meta: {
          title: "账号管理",
          icon: "table"
        }
      },
      {
        path: "weChatUser",
        name: "code_1300",
        component: () => import("@/views/role/weChatUser"),
        meta: {
          title: "微信用户管理",
          icon: "table"
        }
      }
    ]
  },

  {
    path: "/posterPage",
    component: Layout,
    redirect: "/posterPage",
    name: "code_400",
    meta: {
      title: "广告管理",
      icon: "picture"
    },
    children: [
      {
        path: "posterPage",
        name: "code_1300",
        component: () => import("@/views/posterPage/advertisingList"),
        meta: {
          title: "广告列表",
          icon: "table"
        }
      },
      {
        path: "addAdvertising",
        name: "addAdvertising",
        hidden: true,
        component: () => import("@/views/posterPage/addAdvertising"),
        meta: {
          title: "新增广告",
          icon: "table"
        }
      }
    ]
  },
  {
    path: "/classifyManage",
    component: Layout,
    redirect: "/index",
    name: "code_500",
    meta: {
      title: "分类管理",
      icon: "picture"
    },
    children: [
      {
        path: "contentClassify",
        name: "code_1400",
        component: () => import("@/views/classifyManage/contentClassify"),
        meta: {
          title: "内容分类管理",
          icon: "desktop"
        }
      },
      {
        path: "contentChildClassify",
        name: "CONTENT_CHILD_CLASSIFY",
        hidden: true,
        component: () => import("@/views/classifyManage/contentChildClassify"),
        meta: {
          title: "子分类",
          icon: "table"
        }
      },
      {
        path: "areaClassify",
        name: "code_1500",
        component: () => import("@/views/classifyManage/areaClassify"),
        meta: {
          title: "地区分类管理",
          icon: "table"
        }
      },
      {
        path: "industryClassify",
        name: "code_1600",
        component: () => import("@/views/classifyManage/industryClassify"),
        meta: {
          title: "行业分类管理",
          icon: "table"
        },
        children: []
      },
      {
        path: "industryChildClassify",
        name: "INDUSTRY_CHILD_CLASSIFY",
        hidden: true,
        component: () => import("@/views/classifyManage/industryChildClassify"),
        meta: {
          title: "子行业",
          icon: "table"
        }
      }
    ]
  },
  {
    path: "/trafficManage",
    component: Layout,
    redirect: "/trafficManage",
    name: "code_600",
    meta: {
      title: "交通信息管理",
      icon: "appstore"
    },
    children: [
      {
        path: "port",
        name: "code_1700",
        component: () => import("@/views/traffic/trafficList"),
        meta: {
          title: "口岸信息管理",
          icon: "table"
        }
      },
      {
        path: "portDetail",
        name: "PORTDETAIL",
        component: () => import("@/views/traffic/traffic"),
        meta: {
          title: "口岸信息详情",
          icon: "table"
        },
        hidden: true
      },
      {
        path: "railways",
        name: "code_1800",
        component: () => import("@/views/railway/railwayList"),
        meta: {
          title: "铁路信息管理",
          icon: "table"
        }
      },
      {
        path: "railwaysDetail",
        name: "RAILWAYSDETAIL",
        component: () => import("@/views/railway/railway"),
        meta: {
          title: "铁路信息详情",
          icon: "table"
        },
        hidden: true
      },
      {
        path: "sailScheduleDetail",
        name: "code_1900",
        component: () => import("@/views/sailSchedule/sailScheduleDetail"),
        meta: {
          title: "船期信息管理",
          icon: "table"
        }
      }
    ]
  },
  {
    path: "/article",
    component: Layout,
    // 重定向
    redirect: "/article",
    // 不设置name的将为默认的渲染组件
    name: "code_700",
    meta: {
      title: "文章管理",
      icon: "message"
    },
    children: [
      {
        path: "all",
        name: "code_3100",
        component: () => import("@/views/article/all"),
        meta: {
          title: "全部文章",
          icon: "table"
        }
      },
      {
        path: "articleList",
        name: "code_2000",
        component: () => import("@/views/article/articleList"),
        meta: {
          title: "大湾区概览",
          icon: "table"
        }
      },
      {
        path: "policiesList",
        name: "code_2500",
        component: () => import("@/views/article/policiesList"),
        meta: {
          title: "政策",
          icon: "table"
        }
      },
      {
        path: "subsidiesList",
        name: "code_2600",
        component: () => import("@/views/article/subsidiesList"),
        meta: {
          title: "资助及优惠",
          icon: "table"
        }
      },
      {
        path: "networksList",
        name: "code_2700",
        component: () => import("@/views/article/networksList"),
        meta: {
          title: "对接及联络",
          icon: "table"
        }
      },
      {
        path: "supportList",
        name: "code_2800",
        component: () => import("@/views/article/supportList"),
        meta: {
          title: "商务支援",
          icon: "table"
        }
      },
      {
        path: "activitiesList",
        name: "code_2900",
        component: () => import("@/views/article/activitiesList"),
        meta: {
          title: "活动及培训",
          icon: "table"
        }
      },
      {
        path: "intelligenceList",
        name: "code_3000",
        component: () => import("@/views/article/intelligenceList"),
        meta: {
          title: "香港贸发局资讯",
          icon: "table"
        }
      },
      {
        path: "searchArticleList",
        name: "searchArticleList",
        hidden: true,
        component: () => import("@/views/article/searchArticleList"),
        meta: {
          title: "搜索文章",
          icon: "table"
        }
      }
    ]
  },
  {
    path: "/tag",
    component: Layout,
    redirect: "/picture",
    name: "code_800",
    meta: {
      title: "标签管理",
      icon: "picture"
    },
    children: [
      {
        path: "tag",
        name: "TAG",
        component: () => import("@/views/picture/picture"),
        meta: {
          title: "标签管理",
          icon: "table"
        }
      }
    ]
  },
  // {
  //   path: '/picture',
  //   component: Layout,
  //   redirect: '/picture',
  //   name: 'PICTURE',
  //   hidden:true,
  //   meta: {
  //     title: '图片管理',
  //     icon: 'picture'
  //   },
  //   children: [{
  //       path: 'picture',
  //       name: 'PICTURE',
  //       component: () => import('@/views/picture/picture'),
  //       meta: {
  //         title: '图片管理',
  //         icon: 'table'
  //       }
  //     },

  //   ]
  // },
  {
    path: "/systemManage",
    component: Layout,
    redirect: "/systemManage",
    name: "code_900",
    meta: {
      title: "系统内容管理",
      icon: "appstore"
    },
    children: [
      {
        path: "about",
        name: "code_2100",
        component: () => import("@/views/systemManage/about"),
        meta: {
          title: "关于",
          icon: "table"
        }
      },
      {
        path: "aboutContent",
        name: "ABOUT_CONTENT",
        hidden: true,
        component: () => import("@/views/systemManage/aboutContent"),
        meta: {
          title: "查看内容",
          icon: "table"
        }
      },
      {
        path: "film",
        name: "code_2200",
        component: () => import("@/views/systemManage/film"),
        meta: {
          title: "影片教学",
          icon: "table"
        }
      },
      {
        path: "filmContent",
        name: "FILM_CONTENT",
        component: () => import("@/views/systemManage/filmContent"),
        meta: {
          title: "查看内容",
          icon: "table"
        },
        hidden: true
      },
      {
        path: "problemContent",
        name: "PROBLEM_CONTENT",
        component: () => import("@/views/systemManage/problemContent"),
        meta: {
          title: "查看内容",
          icon: "table"
        },
        hidden: true
      },
      {
        path: "liaisonContent",
        name: "LIAISON_CONTENT",
        component: () => import("@/views/systemManage/liaisonContent"),
        meta: {
          title: "查看内容",
          icon: "table"
        },
        hidden: true
      },
      {
        path: "mobile",
        name: "code_2300",
        component: () => import("@/views/systemManage/problem"),
        meta: {
          title: "常见问题",
          icon: "table"
        }
      },

      {
        path: "liaison",
        name: "code_2400",
        component: () => import("@/views/systemManage/liaison"),
        meta: {
          title: "联络",
          icon: "table"
        }
      }
    ]
  }
];

export default new Router({
  // mode: 'history', //后端支持可开
  // scrollBehavior: () => ({ y: 0 }),
  routes: constantRouterMap
});
